#include "frm_free_exercise_doit.h"
#include "ui_frm_free_exercise_doit.h"
#include "frm_free_exercise.h"
#include "frm_menu.h"
#include <QDesktopWidget>
#include <QPixmap>
#include <frm_beats.h>
#include <QDebug>

frm_free_exercise_doit::frm_free_exercise_doit(const QString& name, const QString& initial, const QString& imginitial, const QString& final, const QString& imgfinal, QDialog *parent) :
    QDialog(parent),
    ui(new Ui::frm_free_exercise_doit)
{
    ui->setupUi(this);
    qDebug()<<name <<initial <<imginitial<<final<<imgfinal;//QUITAR
    ui->exerciseName->setText(name);
    ui->initialimg->setText(imginitial);
    ui->initialdoing->setText(initial);
    QPixmap imagen(imginitial);
    ui->initialimg->setPixmap(imagen);
    ui->initialimg->setScaledContents(true);
    ui->initialimg->setFixedSize(200, 200);
    ui->finaldoing->setText(final);
    QPixmap imagenf(imgfinal);
    ui->finalimg->setPixmap(imagenf);
    ui->finalimg->setScaledContents(true);
    ui->finalimg->setFixedSize(200, 200);
    setWindowFlags( Qt:: WindowTitleHint | Qt:: CustomizeWindowHint | Qt:: WindowMinimizeButtonHint | Qt:: WindowMaximizeButtonHint);
    this->move(QApplication::desktop()->screen()->rect().center() - this->rect().center());
}

frm_free_exercise_doit::~frm_free_exercise_doit()
{
    delete ui;
}

void frm_free_exercise_doit::on_btn_back_clicked()
{
    frm_free_exercise *free_exer = new frm_free_exercise();
    this->hide();
    free_exer->show();
}

void frm_free_exercise_doit::on_btn_menu_clicked()
{
    frm_menu *menu = new frm_menu();
    this->hide();
    menu->show();
}

void frm_free_exercise_doit::on_btn_beats_clicked()
{
    frm_beats *beats = new frm_beats(this);
    this->hide();
    beats->show();
}
